Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Delete  a  Terminal  Services  Account  

 Content of Delete a Terminal Services Account.vbs
MD5 Hash: 21F7383087EC1234E3F736C93E81903B
' Description: Deletes the Terminal Services account for fabrikam\bob. Note that in the WQL query you must separate the domain name (fabrikam) and the user name (bob) using two slashes rather than one. Thus the account fabrikam\kenmyer would be listed as fabrikam\\kenmyer.


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
("Select * from Win32_TSAccount Where AccountName = 'FABRIKAM\\bob'")

For Each objItem in colItems
errResult = objItem.Delete()
Next

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a